using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Pub_Module_HeaderIcon : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindHeader();
        }
    }
    private void BindHeader()
    {
         DataSet ds = new DataSet();
            ds.ReadXml(Server.MapPath("~/Database/XML/DbIconHeader.xml"));
            dtlHeaderIcon.DataSource = ds;
            dtlHeaderIcon.DataBind();
     

    }
    protected void dtlHeaderIcon_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Image ImgGrpIcon = new Image();
            ImgGrpIcon = (Image)e.Item.FindControl("ImgGrpIcon");
            string UrlImg = DataBinder.Eval(e.Item.DataItem, "UrlImg").ToString();
            if (DataBinder.Eval(e.Item.DataItem, "TextENG").ToString() == "Basket")
            {                 
                if (Session["sArrPDID"].ToString() != "" || Session["sArrPDID"] != null)
                    ImgGrpIcon.ImageUrl = "~/Images/ImgHeader/FullBasket.gif";
                else
                    ImgGrpIcon.ImageUrl = "~/Images/ImgHeader/EmptyBasket.jpg";
            }
            else
                ImgGrpIcon.ImageUrl = "../../"+ DataBinder.Eval(e.Item.DataItem, "UrlImg").ToString();

        }
    }
}
